package com.hup.sokoban.view.main;

import com.hup.sokoban.view.customView.MapLabel;
import com.hup.sokoban.view.customView.StepRecordPanel;
import com.hup.sokoban.view.customView.mapListView.MapListView;
import com.hup.utils.swing.customView.HScrollPanel;
import com.hup.utils.swing.customView.ImageButton;

import javax.swing.*;
import java.awt.*;

/**
 * @author hugan
 * @date 2020/4/30
 */
public class MainForm {

    public JPanel root;

    public JPanel pLeft;
    public MapListView mapListView;
    public MapLabel mapLabel;
    public StepRecordPanel stepRecordPanel;

    public JCheckBox cbMapList;
    public JButton btnMapDesigner;

    public JButton btnReset;

    public JButton btnSaveProgress;
    public ImageButton btnLoadProgress;
    public ImageButton btnDeleteProgress;

    public JButton btnLoadWinning;
    public ImageButton btnDeleteWinning;
    public ImageButton btnHelp;
    public ImageButton btnNextMap;
    public ImageButton btnMute;

    {
// GUI initializer generated by IntelliJ IDEA GUI Designer
// >>> IMPORTANT!! <<<
// DO NOT EDIT OR ADD ANY CODE HERE!
        $$$setupUI$$$();
    }

    /**
     * Method generated by IntelliJ IDEA GUI Designer
     * >>> IMPORTANT!! <<<
     * DO NOT edit this method OR call it in your code!
     *
     * @noinspection ALL
     */
    private void $$$setupUI$$$() {
        root = new JPanel();
        root.setLayout(new GridBagLayout());
        root.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(0, 3, 3, 3), null));
        pLeft = new JPanel();
        pLeft.setLayout(new GridBagLayout());
        GridBagConstraints gbc;
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        root.add(pLeft, gbc);
        mapListView = new MapListView();
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.fill = GridBagConstraints.BOTH;
        pLeft.add(mapListView, gbc);
        final JPanel panel1 = new JPanel();
        panel1.setLayout(new GridBagLayout());
        gbc = new GridBagConstraints();
        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.fill = GridBagConstraints.BOTH;
        root.add(panel1, gbc);
        mapLabel = new MapLabel();
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.weightx = 1.0;
        gbc.weighty = 1.0;
        gbc.fill = GridBagConstraints.BOTH;
        panel1.add(mapLabel, gbc);
        stepRecordPanel = new StepRecordPanel();
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        panel1.add(stepRecordPanel, gbc);
        final HScrollPanel hScrollPanel1 = new HScrollPanel();
        hScrollPanel1.setHorizontalScrollSize(new Dimension(1, 3));
        hScrollPanel1.setHorizontalScrollUnit(50);
        hScrollPanel1.setVerticalScrollBarPolicy(21);
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 1;
        gbc.gridwidth = 2;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        root.add(hScrollPanel1, gbc);
        final JPanel panel2 = new JPanel();
        panel2.setLayout(new GridBagLayout());
        hScrollPanel1.setViewportView(panel2);
        btnReset = new JButton();
        btnReset.setText("重玩");
        gbc = new GridBagConstraints();
        gbc.gridx = 1;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.insets = new Insets(0, 28, 0, 0);
        panel2.add(btnReset, gbc);
        cbMapList = new JCheckBox();
        cbMapList.setText("关卡列表(X)");
        gbc = new GridBagConstraints();
        gbc.gridx = 0;
        gbc.gridy = 0;
        gbc.anchor = GridBagConstraints.WEST;
        panel2.add(cbMapList, gbc);
        final JPanel spacer1 = new JPanel();
        gbc = new GridBagConstraints();
        gbc.gridx = 8;
        gbc.gridy = 0;
        gbc.weightx = 1.0;
        gbc.fill = GridBagConstraints.HORIZONTAL;
        panel2.add(spacer1, gbc);
        btnSaveProgress = new JButton();
        btnSaveProgress.setText("保存进度");
        gbc = new GridBagConstraints();
        gbc.gridx = 2;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.insets = new Insets(0, 28, 0, 0);
        panel2.add(btnSaveProgress, gbc);
        btnDeleteProgress = new ImageButton();
        btnDeleteProgress.setIcon(new ImageIcon(getClass().getResource("/img/main/icon_delete.gif")));
        btnDeleteProgress.setToolTipText("删除进度");
        gbc = new GridBagConstraints();
        gbc.gridx = 4;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        panel2.add(btnDeleteProgress, gbc);
        btnLoadWinning = new JButton();
        btnLoadWinning.setText("加载通关记录");
        gbc = new GridBagConstraints();
        gbc.gridx = 5;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        gbc.insets = new Insets(0, 28, 0, 0);
        panel2.add(btnLoadWinning, gbc);
        btnDeleteWinning = new ImageButton();
        btnDeleteWinning.setIcon(new ImageIcon(getClass().getResource("/img/main/icon_delete.gif")));
        btnDeleteWinning.setToolTipText("删除通关记录");
        gbc = new GridBagConstraints();
        gbc.gridx = 6;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        panel2.add(btnDeleteWinning, gbc);
        btnLoadProgress = new ImageButton();
        btnLoadProgress.setIcon(new ImageIcon(getClass().getResource("/img/main/icon_load.gif")));
        btnLoadProgress.setToolTipText("加载进度");
        gbc = new GridBagConstraints();
        gbc.gridx = 3;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        panel2.add(btnLoadProgress, gbc);
        btnMapDesigner = new JButton();
        btnMapDesigner.setText("关卡设计");
        gbc = new GridBagConstraints();
        gbc.gridx = 10;
        gbc.gridy = 0;
        gbc.fill = GridBagConstraints.BOTH;
        panel2.add(btnMapDesigner, gbc);
        btnHelp = new ImageButton();
        btnHelp.setIcon(new ImageIcon(getClass().getResource("/img/common/icon_help.gif")));
        btnHelp.setToolTipText("帮助");
        gbc = new GridBagConstraints();
        gbc.gridx = 11;
        gbc.gridy = 0;
        panel2.add(btnHelp, gbc);
        btnNextMap = new ImageButton();
        btnNextMap.setIcon(new ImageIcon(getClass().getResource("/img/winning/icon_next.gif")));
        btnNextMap.setToolTipText("下一关(Enter)");
        btnNextMap.setUnitedIconWidth(5.0f);
        gbc = new GridBagConstraints();
        gbc.gridx = 7;
        gbc.gridy = 0;
        gbc.insets = new Insets(0, 28, 0, 0);
        panel2.add(btnNextMap, gbc);
        btnMute = new ImageButton();
        btnMute.setCheckbox(true);
        btnMute.setIcon(new ImageIcon(getClass().getResource("/img/main/icon_mute.png")));
        btnMute.setToolTipText("静音");
        gbc = new GridBagConstraints();
        gbc.gridx = 9;
        gbc.gridy = 0;
        panel2.add(btnMute, gbc);
    }

    /**
     * @noinspection ALL
     */
    public JComponent $$$getRootComponent$$$() { return root; }

}
